3.82 \(\int \frac{\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx\)

Optimal. Leaf size=33 \[ \frac{2 \tan (c+d x)}{a d (a \sec (c+d x)+a)}-\frac{x}{a^2} \]

[Out]

-(x/a^2) + (2*Tan[c + d*x])/(a*d*(a + a*Sec[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.111743, antiderivative size = 35, normalized size of antiderivative = 1.06, number of steps used = 9, number of rules used = 6, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {3888, 3886, 3473, 8, 2606, 3767} \[ -\frac{2 \cot (c+d x)}{a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}-\frac{x}{a^2} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]^2/(a + a*Sec[c + d*x])^2,x]

[Out]

-(x/a^2) - (2*Cot[c + d*x])/(a^2*d) + (2*Csc[c + d*x])/(a^2*d)

Rule 3888

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rule 3886

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Int[ExpandI
ntegrand[(e*Cot[c + d*x])^m, (a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[n, 0]

Rule 3473

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(b*Tan[c + d*x])^(n - 1))/(d*(n - 1)), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2606

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin{align*} \int \frac{\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx &=\frac{\int \cot ^2(c+d x) (-a+a \sec (c+d x))^2 \, dx}{a^4}\\ &=\frac{\int \left (a^2 \cot ^2(c+d x)-2 a^2 \cot (c+d x) \csc (c+d x)+a^2 \csc ^2(c+d x)\right ) \, dx}{a^4}\\ &=\frac{\int \cot ^2(c+d x) \, dx}{a^2}+\frac{\int \csc ^2(c+d x) \, dx}{a^2}-\frac{2 \int \cot (c+d x) \csc (c+d x) \, dx}{a^2}\\ &=-\frac{\cot (c+d x)}{a^2 d}-\frac{\int 1 \, dx}{a^2}-\frac{\operatorname{Subst}(\int 1 \, dx,x,\cot (c+d x))}{a^2 d}+\frac{2 \operatorname{Subst}(\int 1 \, dx,x,\csc (c+d x))}{a^2 d}\\ &=-\frac{x}{a^2}-\frac{2 \cot (c+d x)}{a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}\\ \end{align*}

Mathematica [A]  time = 0.0218923, size = 42, normalized size = 1.27 \[ \frac{\frac{2 \tan \left (\frac{c}{2}+\frac{d x}{2}\right )}{d}-\frac{2 \tan ^{-1}\left (\tan \left (\frac{c}{2}+\frac{d x}{2}\right )\right )}{d}}{a^2} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]^2/(a + a*Sec[c + d*x])^2,x]

[Out]

((-2*ArcTan[Tan[c/2 + (d*x)/2]])/d + (2*Tan[c/2 + (d*x)/2])/d)/a^2

________________________________________________________________________________________

Maple [A]  time = 0.069, size = 37, normalized size = 1.1 \begin{align*} 2\,{\frac{\tan \left ( 1/2\,dx+c/2 \right ) }{d{a}^{2}}}-2\,{\frac{\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{d{a}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)^2/(a+a*sec(d*x+c))^2,x)

[Out]

2/d/a^2*tan(1/2*d*x+1/2*c)-2/d/a^2*arctan(tan(1/2*d*x+1/2*c))

________________________________________________________________________________________

Maxima [A]  time = 1.76568, size = 66, normalized size = 2. \begin{align*} -\frac{2 \,{\left (\frac{\arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} - \frac{\sin \left (d x + c\right )}{a^{2}{\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+a*sec(d*x+c))^2,x, algorithm="maxima")

[Out]

-2*(arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a^2 - sin(d*x + c)/(a^2*(cos(d*x + c) + 1)))/d

________________________________________________________________________________________

Fricas [A]  time = 1.12642, size = 99, normalized size = 3. \begin{align*} -\frac{d x \cos \left (d x + c\right ) + d x - 2 \, \sin \left (d x + c\right )}{a^{2} d \cos \left (d x + c\right ) + a^{2} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+a*sec(d*x+c))^2,x, algorithm="fricas")

[Out]

-(d*x*cos(d*x + c) + d*x - 2*sin(d*x + c))/(a^2*d*cos(d*x + c) + a^2*d)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\tan ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec{\left (c + d x \right )} + 1}\, dx}{a^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)**2/(a+a*sec(d*x+c))**2,x)

[Out]

Integral(tan(c + d*x)**2/(sec(c + d*x)**2 + 2*sec(c + d*x) + 1), x)/a**2

________________________________________________________________________________________

Giac [A]  time = 1.51605, size = 39, normalized size = 1.18 \begin{align*} -\frac{\frac{d x + c}{a^{2}} - \frac{2 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{a^{2}}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)^2/(a+a*sec(d*x+c))^2,x, algorithm="giac")

[Out]

-((d*x + c)/a^2 - 2*tan(1/2*d*x + 1/2*c)/a^2)/d